package com.entity.serviceorder;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.AllArgsConstructor;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;

@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName("service_orders") // 映射到数据库表名
@ApiModel("服务通知单实体类")
public class ServiceOrder {

    @ApiModelProperty(value = "主键，唯一标识每个服务单")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty(value = "服务单号，唯一标识每个服务单，不能为空")
    @TableField("service_order_number")
    private String serviceOrderNumber;

    @ApiModelProperty(value = "接收时间，默认为当前时间")
    @TableField("receive_time")
    private LocalDate receiveTime;

    @ApiModelProperty(value = "客户公司ID，关联到客户公司表的主键")
    @TableField("customer_company_id")
    private Long customerCompanyId;

    @ApiModelProperty(value = "联系人id")
    @TableField("customer_contacts_id")
    private Long customerContactsId;

    @ApiModelProperty(value = "销售经理ID")
    @TableField("sales_manager_id")
    private Long salesManagerId;

    @ApiModelProperty(value = "服务地点（如：河南省新密市）")
    @TableField("service_location")
    private String serviceLocation;

    @ApiModelProperty(value = "技术对接人id 关联user表")
    @TableField("technical_user_id")
    private Long technicalUserId;

    @ApiModelProperty(value = "工作量核准人id 关联user表")
    @TableField("approver_user_id")
    private Long approverUserId;

    @ApiModelProperty(value = "预期工作描述，说明本次服务的具体内容")
    @TableField("expected_work")
    private String expectedWork;

    @ApiModelProperty(value = "人员安排，格式为人*天（如：1人*1.5天）")
    @TableField("staff_arrangement")
    private String staffArrangement;

    @ApiModelProperty(value = "确认人签章日期，记录服务单的确认时间")
    @TableField("confirm_sign_date")
    private LocalDate confirmSignDate;

    @ApiModelProperty(value = "创建时间，默认为当前时间")
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    @ApiModelProperty(value = "更新时间，每次更新时自动刷新")
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

    @ApiModelProperty(value = "逻辑删除字段，默认为1，删除为0")
    @TableField("is_deleted")
    private Integer isDeleted;

    @ApiModelProperty(value = "总价格")
    @TableField("total")
    private BigDecimal total;

    @ApiModelProperty(value = "状态")
    @TableField("status")
    private String status;

    @ApiModelProperty(value = "创建人")
    @TableField("created_by")
    private String createdBy;

}